package com.tz.cartelo.constant;


import com.tz.cartelo.Globals;
import com.tz.common.constant.HttpMethod;

/**
 * Define all of apis.
 * Created by Chris on 16/7/18.
 */
public enum Api {
    //登录
    LOGIN("user/login", HttpMethod.POST),
    //获取验证码
    GET_CODE("user/sendSMS", HttpMethod.POST),
    //验证验证码
    VERIFY_CODE("user/verifySMS", HttpMethod.POST),
    //忘记密码功能，以手机号修改密码接口
    MODIFY_PASSWORD("user/modifyPassword", HttpMethod.POST),
    //修改手机号，发送手机验证码
    GET_PHONE_CODE("user/sendSMSByPhone", HttpMethod.POST),
    //修改手机号接口
    CHANGE_PHONE("user/modifyPhone", HttpMethod.POST),
    //登录后修改密码
    CHANGE_LOGIN_PHONE("user/modifyLoginPassWord", HttpMethod.POST),
    //商品中心
    GOODS_CENTER("userGoods/detail", HttpMethod.POST),
    //商品类别
    GOODS_CLASSIFY("userGoods/searchList", HttpMethod.POST),
    //搜索商品
    GOODS_CLASSIFY_DETAILS("userGoods/searchResultList", HttpMethod.POST),
    //搜索商品热搜
    GOODS_CLASSIFY_SEARCH("userGoods/searchVolume", HttpMethod.POST),
    //商品详情
    GOODS_DETAIL("userGoods/goodsDetail", HttpMethod.POST),
    //编辑订单  提交订单
    ORDER_GOODS("orderGoods/goodsDetail", HttpMethod.POST),
    //库存统计1
    STOCK_MANAGER("orderGoods/userSearchResultList", HttpMethod.POST),
    //库存统计2
    STOCK_MANAGER_DETAILS("orderGoods/userStockDetail", HttpMethod.POST),
    //库存统计3
    EDIT_STOCK_MANAGER("orderGoods/editInventory", HttpMethod.POST),
    //查询消息未读
    MESSAGE_NUM("information/messageNum", HttpMethod.POST),
    //消息列表
    MESSAGE_INFO("information/info", HttpMethod.POST),
    //消息已读
    MESSAGE_READ("information/messageContent", HttpMethod.POST),
    //我的订单
    MY_ORDER("orderGoods/imOrder", HttpMethod.POST),
    //我的订单详情
    MY_ORDER_DETAILS("orderGoods/imOrderDetail", HttpMethod.POST),


    //检查更新
    CHECK_UP_DATA("", HttpMethod.POST_JSON),
    //重置密码
    FORGET("user/modifyPass.json", HttpMethod.POST_JSON),
    //注册
    REGISTER("user/register.json", HttpMethod.POST_JSON),
    //获取代理类别
    GET_ACT_USER_TYPE("act/getActTypeByUserId.json", HttpMethod.POST_JSON),
    //获取代理用户
    GET_ACT_USER("act/getActUsersByUserId.json", HttpMethod.POST_JSON),
    //添加代理
    ADD_ACT_USER("act/addUserByParentUser.json", HttpMethod.POST_JSON),
    //删除代理
    DELETE_ACT_USER("act/deleteUserByParentUser.json", HttpMethod.POST_JSON),
    //获取微课堂类型列表
    GET_CLASS_CLASSIFY("wclass/getClassCategoryList.json", HttpMethod.POST_JSON),
    //获取微课堂信息列表
    GET_CLASS("wclass/getClassInfoList.json", HttpMethod.POST_JSON),
    //订单创建
    ADD_ORDER("order/addOrderInfo.json", HttpMethod.POST_JSON),
    //获取订单列表
    GET_ORDER_LIST("order/getOrderInfoList.json", HttpMethod.POST_JSON),
    //根据商品分类ID获取该分类下的属性
    GET_PRODUCT_STYLE("product/getProductCategoryAttributeList.json", HttpMethod.POST_JSON),
    //根据父节点ID获取该节点下的分类
    GET_PRODUCT_CLASSIFY("product/getProductCategoryList.json", HttpMethod.POST_JSON),
    //根据类别获取商品列表
    GET_PRODUCT_LIST("product/getCategoryProductList.json", HttpMethod.POST_JSON),
    //根据搜索条件获取商品列表
    GET_SEARCH_LIST("product/getSearchProductList.json", HttpMethod.POST_JSON),
    //根据用户id获取该用户的商品列表
    GET_USER_PRODUCT_LIST("product/getUserProductList.json", HttpMethod.POST_JSON),
    //根据商品ID获取商品详细信息
    GET_PRODUCT_DETAILS("product/getProductDetail.json", HttpMethod.POST_JSON),
    //创建商品
    CREATE_PRODUCT("product/createProduct.json", HttpMethod.POST_JSON),
    //删除商品
    DELETE_PRODUCT("product/deleteProduct.json", HttpMethod.POST_JSON),
    //更新商品
    UPDATE_PRODUCT("product/updateProduct.json", HttpMethod.POST_JSON),
    //创建商品图片
    CREATE_PRODUCT_PIC("product/createProductImg.json", HttpMethod.POST_JSON),
    //更新商品图片
//    UPDATE_PRODUCT_PIC("product/updateProductImg.json", HttpMethod.POST_JSON),
    //库存确认
    MAKE_SURE_STOCK("order/getProductStock.json", HttpMethod.POST_JSON),
    //申请退货
    APPLY_RETURN("order/doOrderReturn.json", HttpMethod.POST_JSON),
    //获取UploadToken
    GET_UPLOAD_TOKEN("order/getUploadToken.json", HttpMethod.POST_JSON),
    //获取首页上面的商品分类
    GET_JADE_CLASSIFY("product/getHomePageCategoryList.json", HttpMethod.POST_JSON),
    //获取审批订单列表
    GET_ORDER_APPROVAL_LIST("order/getOrderApprovalList.json", HttpMethod.POST_JSON),
    //订单审批
    GET_ORDER_APPROVAL("order/doOrderApproval.json", HttpMethod.POST_JSON),
    //新增收货地址
    ADD_ADDRESS("address/addAddress.json", HttpMethod.POST_JSON),
    //编辑收货地址
    EDIT_ADDRESS("address/editAddress.json", HttpMethod.POST_JSON),
    //删除收货地址
    DELETE_ADDRESS("address/deleteAddress.json", HttpMethod.POST_JSON),
    //查询 收货地址
    GET_ADDRESS("address/getAddressList.json", HttpMethod.POST_JSON),
    //微站分享
    GET_SHARE_URL("h5/getShareUrl.json", HttpMethod.POST_JSON),
    //获取用户信息
    GET_USER_MESSAGE("user/getInfo.json", HttpMethod.POST_JSON),
    //更改用户信息
    SET_USER_MESSAGE("user/editInfo.json", HttpMethod.POST_JSON),
    //根据id查询 收货地址
    GET_ADDRESS_BY_ID("address/getAddressById.json", HttpMethod.POST_JSON),
    //登录日志
    LOGIN_LOG("user/loginLog.json", HttpMethod.POST_JSON),
    //获取注册协议
    PROTOCOL_INFO("user/getProtocolInfo.json", HttpMethod.POST_JSON),;

    private String act;

    private HttpMethod httpMethod;

    Api(String act, HttpMethod httpMethod) {
        this.act = act;
        this.httpMethod = httpMethod;
    }

    public String getAct() {
        return act;
    }

    public HttpMethod getHttpMethod() {
        return httpMethod;
    }

    public String getUrl() {
        return Globals.mDomain + act;
    }

}
